/**
 * Copyright (C) 2012 Foxit Corporation.
 * All Rights Reserved.
 *
 * The following code is copyrighted and contains proprietary information and trade secrets of Foxit Corporation.
 * You can only redistribute files listed below to customers of your application, under a written SDK license agreement with Foxit.
 * You cannot distribute any part of the SDK to general public, even with a SDK license agreement.
 * Without SDK license agreement, you cannot redistribute anything.
 *
 * @file	fpdfppo.h
 * @brief	Header file for the PDF ppo module.
 * @details	The ppo module offers:
 *			1. Methods for importing pages from the other PDF document.
 *			2. Methods for flattening the pdf page.
 * @note	If you want to purchase Foxit PDF SDK license and use ANY of the following functions, please
 *			request for enabling PDF object module explicitly.
 */
  
 /** 
 * @addtogroup FGSPDFPPO PDF Ppo
 * @brief Methods in this module are included in fpdfppo.h 
 */
/** @{*/

#ifndef __FGSPDFPPO__
#define __FGSPDFPPO__

#ifndef __FGSPDFBASE__
    #include "fpdfbase.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif

 /**
 * @brief FGSPDF ImportPages Reference.
 */
typedef const struct __FGSPDFImportPages * FGSPDFImportPagesRef;
 
/**
 * @brief Start to import some pages to a PDF document.
 *
 * @param[in] dest_doc		Reference to the destination PDF document which adds the pages to.
 * @param[in] src_doc		Reference to the source PDF document which adds the pages from.
 * @param[in] pagerange		A page range string, Such as "1,3,5-7".<br>
 *  							  If this parameter is NULL, it would import all pages in src_doc.
 * @param[in] index			The page index about where the imported pages are added.
 * @param[in] pause			Pointer to a ::FGSPause struct that controls whether need to be paused when do the importing. 
                            <b>NULL</b> means no need to pause.
 * @param[in] impHandle		Pointer to a Reference that receives a page importing Reference.
 *
 * @return	::kFGSErrorSuccess means set the information successfully.<br>
 *			For more definitions please see enum definitions <b>FGSErrorRet</b>.
 *
 * @note If ::kFGSErrorToBecontinued is returned, ::FGSPDFContinueImportPages needs to be invoked to finish the rest work.
 */
FGSErrorRet FGSPDFStartImportPages(FGSPDFDocumentRef dest_doc,FGSPDFDocumentRef src_doc, CFStringRef pagerange, SInt32 index, FGSPause *pause, FGSPDFImportPagesRef* impHandle);


/**
 * @brief Continue to import some pages to a PDF document.
 *
 * @param[in] impHandle		Reference to the page importing.
 * @param[in] pause			Pointer to a ::FGSPause struct that controls whether need to be paused when do the importing,
 *							<b>NULL</b> means no need to pause.
 *
 * @return ::kFGSErrorSuccess means set the information successfully.<br>
 *		   For more definitions please see enum definitions <b>FGSErrorRet</b>.
 */
FGSErrorRet FGSPDFContinueImportPages(FGSPDFImportPagesRef impHandle, FGSPause *pause);

/**
 * @brief Stop import pages to a PDF document.
 *
 * @param[in] impHandle		Reference to the page importing.
 *
 * @return ::kFGSErrorSuccess means set the information successfully.<br>
 *		   For more definitions please see enum definitions <b>FGSErrorRet</b>.
 */
FGSErrorRet FGSPDFStopImportPages(FGSPDFImportPagesRef impHandle);

/** 
 * @name FGSPDFPPO Enumeration Types
 */
/**@{*/
/**
 * @brief FGSPDF Flatten Result
 */
enum {
    /**  Flatten operation failed. */
    kFGSPDFFlattenFail                  = 0,
    /**  Flatten operation succeed. */
    kFGSPDFFlattenSuccess               = 1,
    /**  There is nothing to flatten. */
    kFGSPDFFlattenNothingtodo           = 2,

};
/** @brief Alias of enumeration for flatten result. */
typedef UInt32 FGSPDFFlattenRet;
    
/**
 * @brief FGSPDF Flatten Type
 */
enum {
    /**  Normal Display.    */
    kFGSPDFFlattenTypeNormal            = 0,
    /**  Print.             */
    kFGSPDFFlattenTypePrint             = 1,
    
};
/** @brief Alias of enumeration for flatten type. */
typedef UInt32 FGSPDFFlattenType;
/**@}*/

/**
 * @brief Flatting a PDF page, annotations or form fields will make it a part of the page contents.
 *
 * @param[in] page		Reference to the page.
 * @param[in] flags		The flag for flatten, refers to macros of  <b>::FGSPDFFlattenType</b>.
 *
 * @return The result of flatten function. refers to macros of  <b>::FGSPDFFlattenRet</b>.
 */
FGSPDFFlattenRet FGSPDFFlattenPage(FGSPDFPageRef page, FGSPDFFlattenType flags);

#ifdef __cplusplus
};
#endif

#endif // __FGSPDFPPO__
/**@}*/


